package cappuccino.couldbook.net;

import android.util.Log;

import com.google.gson.Gson;

import java.util.List;

import cappuccino.couldbook.data.Group;
import cappuccino.couldbook.data.PhoneNumber;
import cappuccino.couldbook.data.Result;
import cappuccino.couldbook.data.User;
import retrofit2.http.GET;
import retrofit2.http.Query;
import rx.Observable;
/**
 * Created by Administrator on 2016/9/5.
 */
public interface NetApi {
    @GET("login")
    public Observable<Result<User>> login(@Query("username")String username,@Query("password")String userpass);

    @GET("register")
    public Observable<Result<User>> register(@Query("username")String username,@Query("loginname")String loginname,@Query("loginpass")String loginpass);

    @GET("addnumber")
    public Observable<Result<PhoneNumber>> addnumber(@Query("userid")int id,@Query("detail")String detail,@Query("number")String number);

    @GET("querynumbers")
    public Observable<Result<List<PhoneNumber>>> querynumbers(@Query("userid")int id);


    @GET("get_groups")
    public Observable<Result<List<Group>>> getGroups(@Query("userid")int id);
    @GET("search_gourp")
    public Observable<Result<List<Group>>> getGroups(@Query("group_name")String name);

    @GET("create_group")
    public Observable<Result<Group>> createGroup(@Query("userid")int id,@Query("name")String name,@Query("detail")String detail);

    @GET("group_detail")
    public Observable<Result<Group>> groupDetail(@Query("groupid")int id);


    @GET("get_applicant")
    public Observable<Result<Group>> getApplicant(@Query("groupid")int id);
    @GET("check_mananger")
    public Observable<Result<List<Group>>> checkMananger(@Query("userid")int id);

    @GET("apply_group")
    public Observable<Result<Group>> applyGroup(@Query("userid")int uid,@Query("groupid")int gid);


    @GET("pass_applicant")
    public Observable<Result<Group>> passApplicant(@Query("userid")int uid,@Query("groupid")int gid);

    @GET("edit_number")
    public Observable<Result<PhoneNumber>> editNumber(@Query("number_id")int nid,@Query("tag")String tag,@Query("number")String number);

    @GET("del_number")
    public Observable<Result<PhoneNumber>> delNumber(@Query("number_id")int nid);
}
